<?php
use yii\db\Schema;
use yii\db\Migration;

class m160426_022426_role extends Migration
{
    public function up()
    {
    	$this->createTable('role', [
    			'id' => Schema::TYPE_PK,
    			'role_name' => Schema::TYPE_STRING . "(255) NOT NULL comment '角色名称'"
       ]);
    	
    	$this->insert('role', [
    	    'role_name' => '超级管理员'
    	]);
    }

    public function down()
    {
        echo "m160426_022426_role cannot be reverted.\n";

        return false;
    }

    /*
    // Use safeUp/safeDown to run migration code within a transaction
    public function safeUp()
    {
    }

    public function safeDown()
    {
    }
    */
}
